import {useNavigate} from 'react-router-dom'
export default ()=>{
    //调用useNavigate()
    const navigate=useNavigate()
    const goLogin=(e)=>{
        navigate("/login")
      e.preventDefault()
    }
    return(<>
       <h1>注册页面</h1>
        <div>
            <form>
                <div>
                    <label>手机:</label>
                    <input type="text" placeholder="请输入手机号"></input>
                </div>
                <div>
                    <label>密码:</label>
                    <input type="passowrd" placeholder="请输入密码"></input>
                </div>
                <div>
                    <button>注册</button>
                    已经有账号了，请直接<a href="#" onClick={goLogin}>登录</a>
                </div>
            </form>
        </div>
    </>)
}